package org.testis.webautomationmodule.ui.objects;

import org.testis.logging.AtofLogLevel;
import org.testis.webautomationmodule.ui.UIBehaviorDecorator;


public class UIConfirmationAlert extends UIBehaviorDecorator
{

    public UIConfirmationAlert()
    {
    }


    @Override
    protected boolean setBehavior()
    {
        String hasConfirmation = getWebAutomationImpl().getEval(
            "selenium.browserbot.hasConfirmations();");
        if (hasConfirmation.equals("true")) {
            String confirmText = getWebAutomationImpl().getConfirmation();
            putLog(" Choosing OK for the  confirmation :(" + confirmText + ")");
            return true;
        }
        else {
            putLog(" No confirmation alert discovered...",AtofLogLevel.WARN);
            return true;
        }
    }
}

